/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.usc.cs576.lib;

/**
 *
 * @author haoxu
 */
public class Action {

    int actionNumber;
    MediaObject source;
    MediaObject target;
    String param1;
    String param2;

    public Action() {
        param1 = "";
        param2 = "";
    }

    public int getActionNumber() {
        return actionNumber;
    }

    public void setActionNumber(int actionNumber) {
        this.actionNumber = actionNumber;
    }

    public MediaObject getTarget() {
        return target;
    }

    public void setTarget(MediaObject target) {
        this.target = target;
    }

    public MediaObject getSource() {
        return source;
    }

    public void setSource(MediaObject source) {
        this.source = source;
    }

    public String getParam1() {
        return param1;
    }

    public void setParam1(String param1) {
        this.param1 = param1;
    }

    public String getParam2() {
        return param2;
    }

    public void setParam2(String param2) {
        this.param2 = param2;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("");
        sb.append("Action:");
        switch (this.actionNumber) {
            case 1:
                sb.append("PLAY_VIDEO");
                break;
            case 2:
                sb.append("PAUSE_VIDEO");
                break;
            case 3:
                sb.append("STOP_VIDEO");
                break;
            case 4:
                sb.append("PLAY_AUDIO");
                break;
            case 5:
                sb.append("PAUSE_AUDIO");
                break;
            case 6:
                sb.append("STOP_AUDIO");
                break;
            case 7:
                sb.append("LINK\n");
                sb.append(this.param1);
                break;
            case 8:
                sb.append("DISPLAY\n");
                sb.append(this.param1).append(" to ").append(this.param2);
                break;
            default:
                sb.append("no Action");
        }
        return sb.toString();
    }
}
